<!--
/**************************************************
* @ bargainmodify.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/04/26, owen
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8"%>
<html>
<head>
<title>修改合同信息</title>
<%@ include file="../common.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=root%>/css/caigouxitong.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/hi-check.js"></SCRIPT>
<SCRIPT language="JavaScript" src="js/calendar.js"></SCRIPT>

<%
//out.println(message);
if(message == null){
GSBargainBean tGSBargainBean=(GSBargainBean)request.getAttribute("BargainBean");
ArrayList tBargainChargeList=new ArrayList();
tBargainChargeList=(ArrayList)request.getAttribute("BargainChargeList");

%>
<script language="javascript">
			function setEnable()
			{
				if (bargainform.Radio2.checked)
				{
					bargainform.manufactureimage.disabled = false;
				}
				else
				{
			    	bargainform.manufactureimage.disabled = true;
					
				}
			}
			
			function setButton()
			{
				if (bargainform.Radio3.checked)
				{
					bargainform.Button4.value = "选择供应商";
					bargainform.gs_bgn_username.value="";
					bargainform.gs_bgn_userid.value="";
				}
				else
				{
					bargainform.Button4.value = "选择采购用户";
					bargainform.gs_bgn_username.value="";
					bargainform.gs_bgn_userid.value="";
				}
			}
			
			function selectCompany()
			{
				if (bargainform.Button4.value == "选择供应商")
				{
					var url = "<%=response.encodeURL(root+"/A170103.do")%>";
		            var returnv = window.open(url,null," edge: sunken ,center: Yes, help: No, resizable: Yes, status: No,height=680px, scrollbars=yes");
		            
				}
				if (bargainform.Button4.value == "选择采购用户")
				{
					var url = "<%=response.encodeURL(root+"/A170105.do")%>";
		            var returnv = window.open(url,null," edge: sunken ,center: Yes, help: No, resizable: Yes, status: No,height=680px, scrollbars=yes");
		            
				}
			}
			
			function mod(){
			  
			 // if(bargainform.gs_bgn_mainserial.disabled == false){
			  //  if(bargainform.gs_bgn_mainserial.value==""){
			  //   alert("主合同编号不能为空！");
			  //   return false;
			 //   }
			 // }
			  
			  var iFields1 = new Array(5);
			  
              iFields1[0] = 'gs_bgn_username||客户名称||Y||1-1000||##';
              iFields1[1] = 'gs_bgn_content||合同（协议）内容||Y||1-1000||##';
              iFields1[2] = 'gs_bgn_serial||编号||Y||1-30||##';
              iFields1[3] = 'gs_bgn_signdate||签约日期||Y||1-30||##';
              iFields1[4] = 'gs_bgn_week||收/付款周期||Y||1-10||#0';
              
        
		      if( HiScript.value(bargainform.name,iFields1) == false)  return false;
			  
			  bargainform.action="<%= response.encodeURL(request.getContextPath() + "/A170206.do") %>";   
	          document.bargainform.submit();
			}
			
			function upload(){
			 
			  bargainform.action="<%= response.encodeURL(request.getContextPath() + "/A170108.do") %>";   
	          bargainform.submit();
			
			}
			function wclose(){
			  window.close();
			}
			</script>
</head>
<body text="#000000" bgColor="#f2f2f2" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
<form name="bargainform" method="post" ENCTYPE="multipart/form-data">
			<p><br>
			</p>
			<table cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
				<tr>
					<td height="20">
						<table cellSpacing="0" cellPadding="1" width="100%" border="0">
							<tr height="20">
								<td class="mtxt_black" width="758" height="30">合同信息修改 
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="bg_line" height="2"></td>
				</tr>
			</table>
			<br>
			<table class="bg_table" id="Table1" style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px" cellSpacing="1"
				cellPadding="0" width="98%" align="center" border="0">
				<TR height="20">
					<TD class="bg_column" align="center" colSpan="4"><b>主体信息</b></TD>
				</TR>
				<TR height="20">
					<TD class="bg_column" align="center" width="15%">序号</TD>
					<TD class="bg_row_odd" colSpan="3"><%=tGSBargainBean.getGs_bgn_id() %>
					<INPUT type="hidden" name="gs_bgn_id" value=<%=tGSBargainBean.getGs_bgn_id() %>>		
				
					</TD>
				</TR>
				<tr height="20">
					<TD class="bg_column" align="center" width="15%">合同类型</TD>
					<TD class="bg_row_odd" align="left" colSpan="3">
					 <%=GSBaseManager.getBargain(tGSBargainBean.getGs_bgn_type()) %> 
						<%if(tGSBargainBean.getGs_bgn_type().equals("2")){ 
						  out.println(tGSBargainBean.getGs_bgn_mainserial());
						  }
						%>
						<INPUT type="hidden" name="gs_bgn_mainserial" value=<%=tGSBargainBean.getGs_bgn_mainserial() %>>		
					</TD>
				</tr>
				<TR height="20">
					<TD class="bg_column" align="center">客户类型</TD>
					<TD class="bg_row_odd" align="left" colspan=3>
					<%if(tGSBargainBean.getGs_bgn_usertype().equals("2")){ %>
						<INPUT id="Radio3" onclick="setButton();" type="radio" CHECKED value="2" name="gs_bgn_usertype">供应商&nbsp;&nbsp;&nbsp;&nbsp;
						<INPUT id="Radio4" onclick="setButton();" type="radio" value="1" name="gs_bgn_usertype">采购用户
					<%}else{ %>
					    <INPUT id="Radio3" onclick="setButton();" type="radio" value="2" name="gs_bgn_usertype">供应商&nbsp;&nbsp;&nbsp;&nbsp;
						<INPUT id="Radio4" onclick="setButton();" type="radio" value="1" name="gs_bgn_usertype" CHECKED>采购用户
					<%} %>
					</TD>
				</tr>
				<tr height=20>
					<TD class="bg_column" align="center" width="15%">客户名称</TD>
					<TD class="bg_row_odd" align="left" colspan=3">
						<INPUT id='provider_name' type="text" name="gs_bgn_username" value=<%=tGSBargainBean.getGs_bgn_userid() %> style="width:60%" readOnly>
						<font color="red">*</font>
						<INPUT id='provider_id' type="hidden" name="gs_bgn_userid" value=<%=tGSBargainBean.getGs_bgn_userid() %> style="width:60%">
						
						<INPUT id='type' type="hidden" name="type" style="width:60%">
						<%if(tGSBargainBean.getGs_bgn_usertype().equals("2")){ %>
						<INPUT class="kuang" type="button" value="选择供应商" name="Button4" onclick="selectCompany();">
						<%}else{ %>
						<INPUT class="kuang" type="button" value="选择采购用户" name="Button4" onclick="selectCompany();">
						<%} %>
					</TD>
				</TR>
				<TR height="20">
					<TD class="bg_column" align="center">合同（协议）内容</TD>
					<TD class="bg_row_odd" colSpan="3" left="right">
					<INPUT style="WIDTH: 98%" type="text" name="gs_bgn_content" value=<%=tGSBargainBean.getGs_bgn_content() %>>
					 <font color="red">*</font>
					</TD>
				</TR>
				<tr>
					<TD class="bg_column" align="center">页数</TD>
					<TD class="bg_row_odd" align="left">
					<input type="text" name="gs_bgn_number" maxlength="3" value=<%=tGSBargainBean.getGs_bgn_number() %>>
					</TD>
					<TD class="bg_column" align="center">附件数</TD>
					<TD class="bg_row_odd" align="left">
					<input type="text" name="gs_bgn_filenumber" maxlength="1" value=<%=tGSBargainBean.getGs_bgn_filenumber() %>>
					</TD>
				</tr>
				<tr height="20">
					<TD class="bg_column" align="center">相关文件上传</TD>
					<TD class="bg_row_odd" colSpan="3">
			        
			        <%if(tGSBargainBean.getGs_bgn_filename().equals("")){ %>
			        <INPUT type="file" size="70" name="manufactureimage" value="请选择您要上传的文件">
			        <INPUT type="hidden" name="delfile" value="new">
			        
			        <%}else{ %>
			        <%=tGSBargainBean.getGs_bgn_filename() %> 文件
			        <INPUT type="hidden" name="gs_bgn_filename" value="<%=tGSBargainBean.getGs_bgn_filename() %>">
			        <INPUT id="Radio1" onclick="setEnable();" type="radio" CHECKED value="1" name="delfile">不删除文件&nbsp;&nbsp;&nbsp;&nbsp;
			        <INPUT id="Radio2" onclick="setEnable();" type="radio" value="2" name="delfile">删除文件
			        <br>
			        <INPUT type="file" size="70" name="manufactureimage" value="请选择您要上传的文件" disabled>
			        <%} %>
				    </TD>
				</tr>
				<TR height="20">
					<TD class="bg_column" align="center">部门</TD>
					<td class="bg_row_odd">
					<INPUT id="Text3" type="text" name="gs_bgn_department" value="<%=tGSBargainBean.getGs_bgn_department() %>">
					</td>
					<TD class="bg_column" align="center">签约人</TD>
					<td class="bg_row_odd">
					<INPUT id="Text7" type="text" name="gs_bgn_signuser" value="<%=tGSBargainBean.getGs_bgn_signuser() %>">
					</td>
				</TR>
				<tr height="20">
					<TD class="bg_column" align="center">签约日期</TD>
					<TD class="bg_row_odd" align="left">
					<input id="Text27" onfocus="setday(this)" readOnly name="gs_bgn_signdate" value=<%=tGSBargainBean.getGs_bgn_signdate() %>>
					 <font color="red">*</font>
					</TD>
					<TD class="bg_column" align="center">终止日期</TD>
					<TD class="bg_row_odd" align="left">
					<input id="Text4" onfocus="setday(this)" readOnly name="gs_bgn_enddate" value="<%=tGSBargainBean.getGs_bgn_enddate() %>">
					</TD>
				</tr>
				<TR height="20">
					<TD class="bg_column" align="center">期限</TD>
					<td class="bg_row_odd">
					<INPUT id="Text8" type="text" name="gs_bgn_term" maxlength="10" value=<%=tGSBargainBean.getGs_bgn_term() %>>
					</td>
					<TD class="bg_column" align="center">卷号</TD>
					<td class="bg_row_odd">
					<INPUT id="Text9" type="text" name="gs_bgn_vol" maxlength="20" value=<%=tGSBargainBean.getGs_bgn_vol() %>>
					</td>
				</TR>
				<TR height="20">
					<TD class="bg_column" align="center">编号</TD>
					<td class="bg_row_odd">
					<INPUT type="text" name="gs_bgn_serial" maxlength="30" value=<%=tGSBargainBean.getGs_bgn_serial() %>>
					<INPUT type="hidden" name="gs_bgn_old_serial" maxlength="30" value=<%=tGSBargainBean.getGs_bgn_serial() %>>
					 <font color="red">*</font></td>
					<TD class="bg_column" align="center">归卷日期</TD>
					<td class="bg_row_odd">
					<input id="Text11" onfocus="setday(this)" readOnly name="gs_bgn_returneddate" value="<%=tGSBargainBean.getGs_bgn_returneddate() %>">
					</td>
				</TR>
				<TR height="20">
					<TD class="bg_column" align="center">收/付款周期</TD>
					<TD class="bg_row_odd" colSpan="3" left="right">
					<INPUT id="Text8" type="text" name="gs_bgn_week" maxlength="10" value="<%=tGSBargainBean.getGs_bgn_week()%>"> 天
					<font color="red">*</font>
					</TD>
				</TR>
				<TR height="20">
					<TD class="bg_column" align="center">备注</TD>
					<TD class="bg_row_odd" colSpan="3" left="right">
					<TEXTAREA id="Textarea2" style="WIDTH: 98%" name="gs_bgn_remark" rows="5" cols="80"><%=tGSBargainBean.getGs_bgn_remark() %></TEXTAREA>
					</TD>
				</TR>
			</table>
			<br>
			<table class="bg_table" id="Table1" style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px" cellSpacing="1"
				cellPadding="0" width="98%" align="center" border="0">
				<TR height="20">
					<TD class="bg_column" align="center" colSpan="2"><b>费用信息</b></TD>
				</TR>
				<tr>
					<TD class="bg_column" align="center"><b>类型</b></TD>
					<TD class="bg_column" align="center"><b>内容</b></TD>
				</tr>
				<%
				  if(tBargainChargeList != null && tBargainChargeList.size() > 0 ){
					for(int i=0; i<tBargainChargeList.size(); i++){
					    GSBargainChargeBean tGSBargainChargeBean = (GSBargainChargeBean)tBargainChargeList.get(i);
						%>
				<tr>
					<TD class="bg_column" align="center">
					<INPUT type="hidden" name="gs_bgc_id" style="width:60%" value="<%=tGSBargainChargeBean.getGs_bgc_id() %>">
					<INPUT type="hidden" name="gs_bgc_type_old" style="WIDTH: 90%" value=<%=tGSBargainChargeBean.getGs_bgc_type() %>>
					<INPUT type="hidden" name="gs_bgc_content_old" style="WIDTH: 90%" value=<%=tGSBargainChargeBean.getGs_bgc_content() %>>
					
					<INPUT type="text" name="gs_bgc_type" style="WIDTH: 90%" value=<%=tGSBargainChargeBean.getGs_bgc_type() %>></TD>
					<TD class="bg_column" align="center">
					<INPUT type="text" name="gs_bgc_content" style="WIDTH: 90%" value=<%=tGSBargainChargeBean.getGs_bgc_content() %>></TD>
				</tr>
				<%
				    }
				  }

				if(tBargainChargeList.size()<6){
				    for(int j=tBargainChargeList.size();j<6;j++){
				%>
				<tr>
					<TD class="bg_column" align="center">
					<INPUT type="text" name="gs_bgc_type" style="WIDTH: 90%"></TD>
					<TD class="bg_column" align="center">
					<INPUT type="text" name="gs_bgc_content" style="WIDTH: 90%"></TD>
				</tr>
				
				<%
				    }
				}
				%>
			</table>
		</form>
		<p align="center">
				<input class="kuang" onclick="return mod()" type="button" value="修改" height="24" width="58">&nbsp; 
				<input class="kuang" onclick="return wclose()" type="button" value="关闭" height="24" width="58"> 
		</p>
	  
	</body>
	<%} %>
</html>